Declare curHCRequest cursor for
select HCRequestID from tblHCRequest

Open curHCRequest

Declare @HCRequestID int
Declare @HCFilled int

FETCH NEXT FROM curHCRequest INTO @HCRequestID

WHILE @@FETCH_STATUS = 0
BEGIN
	SET @HCFilled = 0
	Select @HCFilled = Count(HCRequestID) from tblHireOffer Where JOStatusID IN (1,2) And HCRequestID = @HCRequestID

	Update tblHCRequest SET HCFilled = @HCFilled Where HCRequestID = @HCRequestID

	FETCH NEXT FROM curHCRequest INTO @HCRequestID
END

Close curHCRequest
Deallocate curHCRequest